#ifndef CLIENTWAITPOOL_H
#define CLIENTWAITPOOL_H

#include <qmutex.h>
#include <QMutexLocker>
#include <qmap.h>

class Client;

class ClientWaitPool
{

public:

    static ClientWaitPool *getInstance()
    {
        QMutexLocker locker(&m_mutex);
        if(m_instance == NULL)
        {
            m_instance = new ClientWaitPool();
        }
        return m_instance;
    }

    ClientWaitPool();

    ~ClientWaitPool();

    int addWaitClient(Client *client);

    int removeWaitClient(unsigned int request_id);

    Client *getWaitClient(unsigned int request_id);

private:

    static QMutex m_mutex;

    QMap<unsigned int, Client*> *m_waitClientList;

    static ClientWaitPool *m_instance;
};


#endif
